//
//  SelfClaimTableViewCell.m
//  MemberProject
//
//  Created by vincent luo on 15/7/20.
//  Copyright (c) 2015年 MAC OS X. All rights reserved.
//

#import "SelfClaimTableViewCell.h"

@implementation SelfClaimTableViewCell

- (void)awakeFromNib {
    // Initialization code
    //创建工具条
    UIToolbar *toolbar=[[UIToolbar alloc]init];
    //设置工具条的颜色
    //设置工具条的frame
    toolbar.frame=CGRectMake(0, 0, SCREEN_WIDTH, 44);
    
    //给工具条添加按钮
    UIBarButtonItem *item0=[[UIBarButtonItem alloc]initWithTitle:@"取消" style:UIBarButtonItemStylePlain target:self action:@selector(click:) ];
    
    
    UIBarButtonItem *item1=[[UIBarButtonItem alloc]initWithTitle:@"确定" style:UIBarButtonItemStylePlain target:self action:@selector(click:)];
    item1.tag = 12;
    
    UIBarButtonItem *item2=[[UIBarButtonItem alloc]initWithBarButtonSystemItem:UIBarButtonSystemItemFlexibleSpace target:nil action:nil];
    
    toolbar.items = @[item0,item2 ,item1 ];
    //设置文本输入框键盘的辅助视图
    self.inputTextField.inputAccessoryView=toolbar;
}
-(void)click:(UIBarButtonItem *)sender
{
    [self.inputTextField resignFirstResponder];
    if (sender.tag ==12)
    {
        self.cfBlock();
    }
}
-(void)confirmAction:(confirmBlock)block
{
    self.cfBlock = block;
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
